< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03060400.xhp

(section: not) (bookmark: bm_id3156024)
Not operator (logical)

Not 論理演算子

Not-Operator [Runtime]
Not 演算子 [実行時](hd_id3156024.1)

Negates an expression by inverting the bit values.
ビット値を反転させて、表式の論理否定を取ります。(par_id3159414.2)

(/section: not)

Syntax:
構文:(hd_id3149457.3)

Result = Not Expression
Result = Not Expression(par_id3150360.4)

Parameters:
パラメータ:(hd_id3151211.5)

Result: Any numeric variable that contains the result of the negation.
Result: 演算結果を格納する数値変数。(par_id3147228.6)

Expression: Any expression that you want to negate.
Expression: 論理否定を行う式。(par_id3154124.7)

When a Boolean expression is negated, the value True changes to False, and the value False changes to True.
ブール型の表式に対して論理否定による演算を行う場合、True の値は False に変換され、False の値は True に変換されます。(par_id3150868.8)

In a bitwise negation each individual bit is inverted.
ビット単位の論理否定を行う場合は、個々のビットが反転されます。(par_id3145785.9)

Example:
例:(hd_id3153093.10)

Sub ExampleNot
Sub ExampleNot(par_id3153143.11)

Dim vA as Variant, vB as Variant, vC as Variant, vD as Variant
Dim vA as Variant, vB as Variant, vC as Variant, vD as Variant(par_id3147317.12)

Dim vOut as Variant
Dim vOut as Variant(par_id3145274.13)

vA = 10: vB = 8: vC = 6: vD = Null
vA = 10:vB = 8:vC = 6:vD = Null(par_id3153363.14)

vOut = Not vA REM Returns -11
vOut = Not vA REM 戻り値は -11(par_id3145749.15)

vOut = Not(vC > vD) REM Returns -1
vOut = Not(vC > vD) REM Returns -1(par_id3148645.16)

vOut = Not(vB > vA) REM Returns -1
vOut = Not(vB > vA) REM 戻り値は -1(par_id3156441.17)

vOut = Not(vA > vB) REM Returns 0
vOut = Not(vA > vB) REM 戻り値は0(par_id3152596.18)

end Sub
end Sub(par_id3154319.19)


< Prev / Next >